<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="org.springframework.jdbc.core.JdbcTemplate"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="java.util.Enumeration"%>
<%@page import="java.net.InetAddress"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="TENCENT_ONLINE_PAYMENT" content="China TENCENT">
<title>參數測試</title>
</head>
<body>
<br>
success
<%

InetAddress inetaddress = InetAddress.getLocalHost();
out.println("IP: " + inetaddress.getHostAddress());
out.println("<br>Name: " + inetaddress.getHostName());
%><BR>
<%=request.getMethod() %><br>
===================================header==========================================<br>
<%
Enumeration ha = request.getHeaderNames();
while (ha.hasMoreElements()) {
	String name = (String)ha.nextElement();
	String value = request.getHeader(name);	
	//for(int i = 0; i < value.length;i++){
		out.println("header_"+name+"="+value+"<br>");
	//}
}
%>
===================================Attribute==========================================<br>
<%
Enumeration at = request.getAttributeNames();
while (at.hasMoreElements()) {
	String name = (String)at.nextElement();
	
	//for(int i = 0; i < value.length;i++){
		out.println(name+"="+request.getAttribute(name)+"<br>");
	//}
}
%>
===================================parameter==========================================<br>
<%
Enumeration ea = request.getParameterNames();
while (ea.hasMoreElements()) {
	String name = (String)ea.nextElement();
	String[] value = request.getParameterValues(name);	
	for(int i = 0; i < value.length;i++){
		out.println(name+"="+value[i]+"<br>");
	}
}%>
===================================ServerValue==========================================<br>
<%
out.println("front=" + ServerValue.frontToHtmlString()+"<br>");
out.println("midend=" + ServerValue.frontToHtmlString()+"<br>");
out.println("backend=" + ServerValue.frontToHtmlString()+"<br>");
%>
===================================sql==================================================<br>
<%
try{
	JdbcTemplate jdbcTemplate = (JdbcTemplate)WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext()).getBean("jdbcTemplate");
	String result = jdbcTemplate.queryForObject("select 10 from dual", String.class);
	out.println("["+result+"]");
}catch(Exception e){
	
}finally{
	
}
%>
</body>
</html>